package com.synergy.stockflow.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;

@Configuration
@EnableKnife4j
public class OpenApiConfig {
    @Bean
    public OpenAPI openAPI() {
        Contact author = new Contact().name("YHCinaMoll").email("2902344492@qq.com");
        Info info = new Info()
                .title("企业资源计划（ERP）管理系统 API 文档")
                .description("基于Knife4j OpenAPI3的接口文档")
                .version("1.0")
                .contact(author)
                .termsOfService(
                        "本企业资源计划（ERP）管理系统基于 Spring Boot + Vue 技术栈开发，" +
                        "致力于整合企业采购、销售、生产、财务、物料、仓储等核心业务流程，" +
                        "实现企业资源的高效管理与优化配置。");
        return new OpenAPI().info(info).addServersItem(new Server().url("http://127.0.0.1:8080/")).addServersItem(new Server().url("http://192.168.0.126/stockflow/"));
    }
}
